#include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <iomanip>
using namespace std;
int main() {
    int a, b;
    string cycle = " = number of digits in repeating cycle";
    while(cin >> a >> b){
        double A = a;
        string ans;
        int quo = 0;
        while(quo*b < A) ++quo;
        quo--;
        stringstream ss;
        ss << quo << '.';
        A -= quo*b;
        for(int i=1, j=0; i<=b; i++, j++){
        quo = 1;
        int shift = -i;
        A*= pow(10, j);
        while(b*quo * pow(10, shift+j) < A) ++quo;
        quo--;
        ss << quo;
        A -= b*quo * pow(10, shift + j);
        cout << ss.str() << endl;
        cout << fixed  << setprecision(20)<< A << endl;
        system("PAUSE");
    }
    cout << ss.str() << endl;
    system("PAUSE");
    }
    return 0;
}
